<!--
	缺陷单编辑
-->
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>JZ-energy</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="../css/mui.min.css"/>
		<link rel="stylesheet" type="text/css" href="../css/public.css"/>
		<link rel="stylesheet" type="text/css" href="../css/icons-extra.css" />
		<link rel="stylesheet" type="text/css" href="../css/mui.picker.min.css" />
		<style type="text/css">
			.mui-input-group .mui-input-row { height: 50px;}
			.mui-input-row label {padding: 16px 15px;}
			input[type=text] {height: 50px;}
			input::-webkit-input-placeholder, textarea::-webkit-input-placeholder{color: #BDBDBD;}
		</style>
	</head>
	<body>
		<!--底部导航栏-->
		<nav class="mui-bar mui-bar-tab bg-FFF">
			<a class="mui-tab-item" href="index.html">
				<span class="mui-icon"><img src="../img/index.png"/></span>
				<span class="mui-tab-label">首页</span>
			</a>
			<a class="mui-tab-item" href="monitor.html">
				<span class="mui-icon"><img src="../img/jiance.png"/></span>
				<span class="mui-tab-label">监测</span>
			</a>
			<a class="mui-tab-item" href="work.html">
				<span class="mui-icon"><img src="../img/gongzuo.png"/></span>
				<span class="mui-tab-label">工作</span>
			</a>
			<a class="mui-tab-item" href="myInfor.html">
				<span class="mui-icon"><img src="../img/wode.png"/></span>
				<span class="mui-tab-label">我的</span>
			</a>
		</nav>
		<!--头部导航栏-->
		<header class="mui-bar mui-bar-nav bg-FFF header-bom">
			<a href="index.html" class="mui-action-back mui-icon-extra mui-icon-extra-arrowleftcricle mui-pull-left col-fonts"></a>
			<h1 class="mui-title col-fonts">编辑缺陷单</h1>
		</header>
		<div class="mui-content bg-F8F font-15">
			<form class="mui-input-group af-he be-he">
				<input type="hidden" name="defid" id="defid"/>
				<div class="mui-input-row col-fonts af-he line2">
					<label for="">缺陷级别</label>
					<!-- todo 从数据库取消缺结果进行选择-->
					<div class="mui-pull-right wrapbox" id="level">
						<span class="scord font-13 rightSplit on-active" data-value="0">一般</span>
						<span class="scord font-13" data-value="1">紧急</span>
					</div>
				</div>
				<div class="mui-input-row af-he line2">
					<div class="mui-navigate-right col-fonts">
						<label for="">发现时间</label>
						<input type="text" value="2017-10-8 00:00" name="buildtime" id="buildtime" readonly="readonly" class="defectTime font-15"/>
					</div>
				</div>
				<div class="mui-input-row col-fonts af-he line2" style="height: auto;">
					<label for="">缺陷描述</label>
					<textarea name="des" id="des" rows="3" cols="" class="font-15" maxlength="500" placeholder="请填写文字"></textarea>
				</div>
				<div class="mui-input-row col-fonts af-he line2">
					<label for="">消缺人</label>
					<input type="text" value="" placeholder="请填写文字"  name="dealuser" class="font-15" id="dealuser" maxlength="200"/>
				</div>
				<div class="mui-input-row col-fonts af-he line2">
					<label for="">消缺结果</label>
					<div class="mui-pull-right wrapbox" id="result">
						<span class="update-btn font-13 rightSplit on-active" data-value="0">未消缺</span>
						<span class="update-btn font-13 rightSplit" data-value="1">已消缺</span>
						<span class="update-btn font-13" data-value="2">有遗留</span>
						<!-- todo 从数据库取消缺结果进行选择-->
					</div>
				</div>
				<div class="mui-input-row af-he line2">
					<div class="mui-navigate-right col-fonts">
						<label for="">消缺时间</label>
						<input type="text" value="" name="finishtime" id="finishtime" readonly="readonly" class="resultTime font-15"/>
					</div>
				</div>
				<div class="mui-input-row col-fonts af-he line2" style="height: auto;">
					<label for="">遗留内容</label>
					<textarea name="surplus" id="surplus" rows="3" cols="" class="font-15" maxlength="500" placeholder="请填写文字"></textarea>
				</div>
				<div class="mui-input-row col-fonts af-he line2" style="height: auto;">
					<label for="">备注</label>
					<textarea name="remark" id="remark" rows="3" cols="" placeholder="请填写文字" class="font-15" maxlength="500"></textarea>
				</div>
			</form>
			<div class="mui-content-padded submitBtn">
				<button type="button" class="mui-btn mui-btn-block submit-btn col-FFF font-15" onclick="savedef()">保存</button>
			</div>
		</div>
	</body>
	<script src="../js/jquery.min.js"></script>
	<script src="../js/mui.min.js"></script>
	<script src="../js/main.js"></script>
	<script src="../js/mui.picker.min.js"></script>
	<script src="../js/resultSelect.js"></script>
	<script src="../js/defect/defectEdit.js"></script>
	
	<script>
	initItem();
	mui.init({
		beforeback: function() {
			try{
				var  detailPage = plus.webview.getWebviewById('defectQXD');
				mui.fire(detailPage,'refresh',param);
			}catch(e){
				
			}
		}
	})
	function initItem(){
        	var date = new Date();
        (function($) {
        	//开始时间和结束时间设置
        	var options = {
        		"type": "datetime", 
        		"beginDate": new Date(2000,0,1,1,1),
        		"endDate": new Date()
        	}
        	$('.defectTime').off("tap");
			$('.defectTime').on('tap', function() {
				$(this).focus();
				var picker = new mui.DtPicker(options);
				picker.show(function(rs) {
					$('.defectTime')[0].value=rs.text;
					picker.dispose();
				});
			});
			$('.resultTime').off("tap");
			$('.resultTime').on('tap', function() {
				$(this).focus();
				var picker = new mui.DtPicker(options);
				picker.show(function(rs) {
					$('.resultTime')[0].value=rs.text;
					picker.dispose();
				});
			});
		})($);
		$("#buildtime").val(date.format("yyyy-MM-dd hh:mm"));
		$("nav a").removeClass("mui-active");
		$("nav a").find("img").each(function(){
			var newsrc = $(this).attr("src").replace("-hover","");
			$(this).attr("src",newsrc);
		});
		$("nav a").find("img[src*='"+param.sel+"']").attr("src","../img/"+param.sel+"-hover.png");
        $("nav a").find("img[src*='"+param.sel+"']").closest("a").addClass("mui-active");
	}
	</script>
</html>
